<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>详情</title>
    <link rel="stylesheet" href="../../layui/css/layui.css" />
    <style>
        .layui-input {
            width: 220px;
        }
        .layui-form-item{
            margin-top: 5px;
            padding-bottom: 15px;
        }
    </style>
</head>
<body>
<form class="layui-form" action="" lay-filter="upd">
    <input type="hidden" id="hid" name="hid">
    <div class="layui-form-item">
        <label class="layui-form-label">单元号</label>
        <div class="layui-input-inline">
            <input type="text" name="hunitNumber" id="hunitNumber" required  lay-verify="required" placeholder="请输入单元号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">楼层</label>
        <div class="layui-input-inline">
            <input type="text" name="hfloor" id="hfloor" required  lay-verify="required" placeholder="请输入楼层" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">房间号</label>
        <div class="layui-input-inline">
            <input type="text" name="hroomNo" id="hroomNo" required  lay-verify="required" placeholder="请输入房间号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">房间面积</label>
        <div class="layui-input-inline">
            <input type="text" name="hacreage" id="hacreage" required  lay-verify="required" placeholder="请输入房间面积" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">装修风格</label>
        <div class="layui-input-inline">
            <input type="text" name="hfitment" id="hfitment" required  lay-verify="required" placeholder="请输入装修风格" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">限住人数</label>
        <div class="layui-input-inline">
            <input type="text" name="hlimit" id="hlimit" required  lay-verify="required" placeholder="请输入限住人数" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">配套设施</label>
        <div class="layui-input-inline">
            <input type="text" name="hfacility" id="hfacility" required  lay-verify="required" placeholder="请输入配套设施" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">出租价格</label>
        <div class="layui-input-inline">
            <input type="text" name="hprice" id="hprice" required  lay-verify="required" placeholder="请输入出租价格" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否出租</label>
        <div class="layui-input-inline">
            <input type="text" name="hstatus" id="hstatus" required  lay-verify="required" placeholder="请输入是否出租" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">修改时间</label>
        <div class="layui-input-block">
            <input name="hupdateTime" id="hupdateTime" type="text" class="layui-input" id="test1">
        </div>
    </div>
</form>
<script src="/static/js/jquery-3.3.1.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    //Demo
    layui.use(['form','laydate'], function() {
        var $ = layui.$;
        $().ready(function () {
            $.ajax({
                url: "/HouseServlet?method=queryone",
                type: "get",
                dataType: "json",
                data: {"hid": getQueryString("hid")},
                success: function (da) {
                    if (da.code == 0) {
                        $.each(da.data, function (update, u) {
                            $("#hid").val(u.hid);
                            $("#hunitNumber").val(u.hunitNumber);
                            $("#hfloor").val(u.hfloor);
                            $("#hroomNo").val(u.hroomNo);
                            $("#hacreage").val(u.hacreage);
                            $("#hfitment").val(u.hfitment);
                            $("#hlimit").val(u.hlimit);
                            $("#hfacility").val(u.hfacility);
                            $("#hprice").val(u.hprice);
                            u.hstatus==1?$("#hstatus").val("未出租"):$("#hstatus").val("已出租");
                            $("#hupdateTime").val(layui.util.toDateString(u.hupdateTime, 'yyyy-MM-dd'));
                            //$('#ctime').val(layui.util.toDateString(u.ctime,'yyyy-MM-dd'));
                        })
                    } else {
                        layer.msg("查询数据失败！");
                    }
                }
            })
        })
        $(function () {
            $("input").prop("disabled", "disabled");
            $("select").prop("disabled","disabled");
            // $("textarea").prop("disabled", "disabled");
        })


        //获取传来的？后的 字段参数
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return null;
        }
    })
</script>
</body>
</html>